{% extends "myadmin/base.html" %}


{% block mainbody %}



 <div class="row">
        <div class="col-xs-12">
          <div class="box">
            <div class="box-header">
              <h3 class="box-title">学员案例列表</h3>
              <div class="pull-right"><a href="{% url 'myadmin_article_student_add' %}"><button class="btn btn-block btn-success">添加案例</button></a></div>
                  <form class="form-inline" action="{% url 'myadmin_article_student_index' 1 %}" method="get">
                          <div class="form-group" >
                            <label> &nbsp; 关键字：</label>
                            <input type="text" name="keyword" value="{{request.GET.keyword}}" class="input-small" placeholder="名称">
                            <label> &nbsp; 是否推荐：</label>
                            <select name="recommend" class="span1">
                                <option value="">全部</option>
                                <option value="0" {% if request.GET.recommend == '0' %}selected{% endif %}>否</option>
                                <option value="1" {% if request.GET.recommend == '1' %}selected{% endif %}>是</option>
                            </select>
                          </div>
                        <button type="submit" class="btn btn-default">搜索</button>
                  </form>
            </div>

            <!-- /.box-header -->
            <div class="box-body table-responsive no-padding">
              <table class="table table-hover">
                <tr>
                  <th>ID号</th>
                  <th>案例名称</th>
                  <th>图片</th>
                  <th>点击量</th>
                  <th>是否推荐</th>
                  <th>注册时间</th>
                  <th>操作</th>
                </tr>
                {% for vo in articlelist%}
                <tr>
                  <td>{{vo.id}}</td>
                  <td>{{vo.name}}</td>
                  <td><img src="/static/article/m_{{ vo.pic_url }}" width="60"/></td>
                  <td>{{vo.clicknum}}</td>
                  <td>{% if vo.recommend == 1 %}是{% else %}否{% endif %}</td>
                  <td>{{vo.addtime}}</td>
                  <td><a href="{% url 'myadmin_article_student_edit' vo.id %}" type="button" class="btn btn-success btn-xs">编辑</a> <a href="{% url 'myadmin_article_del' vo.id %}" type="button" class="btn btn-danger btn-xs">删除</a></td>

                </tr>
                {% endfor%}
              </table>
            </div>
            <!-- /.box-body -->
          </div>
          <!-- /.box -->
        </div>
      </div>
      
<div class="col-sm-7">
  <div class="dataTables_paginate paging_simple_numbers" id="example2_paginate">
    <ul class="pagination">
      <li {% if pIndex == 1 %} class="paginate_button previous disabled" {% else %}class="paginate_button previous"
      {% endif %} id="example2_previous"><a href="{% url 'myadmin_article_student_index' pIndex|add:-1 %}?{{ mywhere|join:'&' }}" aria-controls="example2" data-dt-idx="0" tabindex="0">Previous</a></li>
      {% for p in plist %}
      <li {% if pIndex == p %}class="paginate_button active"{% else %}class="paginate_button"
      {% endif %}><a href="{% url 'myadmin_article_student_index' p %}?{{ mywhere|join:'&' }}" aria-controls="example2" data-dt-idx="{{p}}" tabindex="0">{{p}}</a></li>
      {% endfor %}

      <li {% if pIndex == maxpages %} class="paginate_button next disabled" {% else %}class="paginate_button next"
      {% endif %} id="example2_next"><a href="{% url 'myadmin_article_student_index' pIndex|add:1 %}?{{ mywhere|join:'&' }}" aria-controls="example2" data-dt-idx="{{maxpages|add:1}}" tabindex="0">Next</a></li>
    </ul>
  </div>

{% endblock %}